<template>
  <BaseDialog ref="baseDialog" :title="'审核记录'" @cancel="close">
    <div v-for="item in list" :key="item.id" class="item">
      <div v-if="item.result != 0" >
       <div> 操作人：{{ item.nick }}</div>
       <div> 记录： {{ item.result == 1 ? "通过申请" : "拒绝申请" }}</div>
       <div> 原因： {{ item.note }}</div>
      </div>
      <div v-else>
        暂无历史记录
      </div>
    </div>
  </BaseDialog>
</template>

<script>
import { Message } from "element-ui";
import { approvalHistory } from "@/api/review";
export default {
  name: "add",
  data() {
    return {
      title: "",
      orgCode: null,
      isEdit: false,
      list: [],
    };
  },
  methods: {
    async open(row) {
      row ? (this.isEdit = true) : (this.isEdit = false);
      this.$refs.baseDialog.open();
      const res = await approvalHistory({
        orgCode: row.orgCode,
      });
      this.list = res.content;
    },
    close() {
      this.$refs.baseDialog.close();
    },
  },
};
</script>

<style lang="scss" scoped>
.item{
    margin-bottom: 10px;
    border-bottom: 1px solid #ccc;
    padding-bottom: 10px;
    div{
        margin: 5px 0;
        word-break: break-all;
    }
}
</style>
